﻿@model DFYE.Web.Models.studentDaily
@using DFYE.Web.Models;

@{
    ViewBag.Title = "Edit";

    List<studentDailyType> sdt = ViewBag.studentDailyType as List<studentDailyType>;
}

<h2>@Model.student.name 的日志 - 编辑</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>学生日志</legend>

        @Html.HiddenFor(model => model.ID)

        <div class="editor-label">
            日志标题(可为空)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.title)
            @Html.ValidationMessageFor(model => model.title)
        </div>

        <div class="editor-label">
            日志内容
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.content, new { @class = "larg areaLarg" })
            @Html.ValidationMessageFor(model => model.content)
        </div>

        <div class="editor-label">
            创建时间
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.createDate)
            @Html.ValidationMessageFor(model => model.createDate)
        </div>

        <div class="editor-field">
            @Html.HiddenFor(model => model.studentID)
            @Html.ValidationMessageFor(model => model.studentID)
        </div>

        <div class="editor-label">
            日志类型
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.studentDailyTypeID, new SelectList(sdt, "ID", "name"))
            @Html.ValidationMessageFor(model => model.studentDailyTypeID)
        </div>

@*        <div class="editor-label">
            @Html.LabelFor(model => model.teacherID)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.teacherID)
            @Html.ValidationMessageFor(model => model.teacherID)
        </div>

        <div class="editor-label">
            教师名字
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.tearcherName)
            @Html.ValidationMessageFor(model => model.tearcherName)
        </div>*@
        <div class="editor-label">
            有效性
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.able)
            @Html.ValidationMessageFor(model => model.able)
        </div>
        <p>
            <input type="submit" value="Save" class="submitBtn" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("返回列表", "Index")
</div>
<script>
    $("#createDate").attr("readonly", "true").datepicker();
</script>